# frozen_string_literal: true

FactoryBot.define do
  factory :vs_affected_component, class: '::Gitlab::VulnerabilityScanning::AffectedComponent' do
    sequence(:name) { |n| "component-#{n}" }
    sequence(:version) { |n| "v0.0.#{n}" }

    type { "library" }
    purl_type { 'npm' }

    skip_create

    initialize_with do
      Gitlab::VulnerabilityScanning::AffectedComponent.new(
        name: name,
        version: version,
        purl_type: purl_type,
        type: type
      )
    end
  end
end
